'''------------------------------------------------------------------------------------------------
 $ @Author: your name
 $ @Date: 2021-12-23 19:21:50
 $ @LastEditTime: 2021-12-23 19:48:08
 $ @LastEditors: Please set LastEditors
 $ @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 $ @FilePath: \YSQTrackerEvaluationToolKit_v1.0\GetCfg\getCfg_OutPutVisRes.py
--------------------------------------------------------------------------------------------------'''
from yacs.config import CfgNode as CN

_C = CN()
_C.outputVideosList = []

'''-------------------------------------------------------------------------------------------
 * @description: 获取一个空的cfg对象
 * @param {*}
 * @return {*}
---------------------------------------------------------------------------------------------'''
def _get_cfg_def():
    return _C.clone()

'''-------------------------------------------------------------------------------------------
 * @description: 读取yaml文件中的配置
 * @param {str} yamlDir -》 yaml文件的地址
 * @param {bool} freeze -》 是否需要冻结参数。默认为冻结
 * @return {*}
---------------------------------------------------------------------------------------------'''
def getYamlCfg(yamlDir:str,freeze:bool = True)->CN:
    cfg = _get_cfg_def()
    cfg.merge_from_file(yamlDir)
    if freeze:
        cfg.freeze()
    return cfg